package com.example.plan.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import lombok.Data;

/**
 * 无人机设备表
 * @TableName drone
 */
@TableName(value ="drone")
@Data
public class Drone implements Serializable {
    /**
     * 无人机ID
     */
    @TableId(value = "drone_id", type = IdType.AUTO)
    private Long drone_id;

    /**
     * 无人机型号
     */
    @TableField(value = "model")
    private Object model;

    /**
     * 设备状态
     */
    @TableField(value = "status")
    private Object status;

    /**
     * 当前位置经纬度
     */
    @TableField(value = "current_location")
    private Integer current_location;

    /**
     * 最大载重（kg）
     */
    @TableField(value = "max_load")
    private BigDecimal max_load;

    /**
     * 续航时间（分钟）
     */
    @TableField(value = "battery_life")
    private Integer battery_life;

    /**
     * 是否防水
     */
    @TableField(value = "is_waterproof")
    private Integer is_waterproof;

    /**
     * 上次维护日期
     */
    @TableField(value = "last_maintenance")
    private Date last_maintenance;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Drone other = (Drone) that;
        return (this.getDrone_id() == null ? other.getDrone_id() == null : this.getDrone_id().equals(other.getDrone_id()))
            && (this.getModel() == null ? other.getModel() == null : this.getModel().equals(other.getModel()))
            && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
            && (this.getCurrent_location() == null ? other.getCurrent_location() == null : this.getCurrent_location().equals(other.getCurrent_location()))
            && (this.getMax_load() == null ? other.getMax_load() == null : this.getMax_load().equals(other.getMax_load()))
            && (this.getBattery_life() == null ? other.getBattery_life() == null : this.getBattery_life().equals(other.getBattery_life()))
            && (this.getIs_waterproof() == null ? other.getIs_waterproof() == null : this.getIs_waterproof().equals(other.getIs_waterproof()))
            && (this.getLast_maintenance() == null ? other.getLast_maintenance() == null : this.getLast_maintenance().equals(other.getLast_maintenance()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getDrone_id() == null) ? 0 : getDrone_id().hashCode());
        result = prime * result + ((getModel() == null) ? 0 : getModel().hashCode());
        result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
        result = prime * result + ((getCurrent_location() == null) ? 0 : getCurrent_location().hashCode());
        result = prime * result + ((getMax_load() == null) ? 0 : getMax_load().hashCode());
        result = prime * result + ((getBattery_life() == null) ? 0 : getBattery_life().hashCode());
        result = prime * result + ((getIs_waterproof() == null) ? 0 : getIs_waterproof().hashCode());
        result = prime * result + ((getLast_maintenance() == null) ? 0 : getLast_maintenance().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", drone_id=").append(drone_id);
        sb.append(", model=").append(model);
        sb.append(", status=").append(status);
        sb.append(", current_location=").append(current_location);
        sb.append(", max_load=").append(max_load);
        sb.append(", battery_life=").append(battery_life);
        sb.append(", is_waterproof=").append(is_waterproof);
        sb.append(", last_maintenance=").append(last_maintenance);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}